from re import S, T
from numpy import square
from manimlib import *
#75cfb8
#bbdfc8
#f0e5d8
#ffc478
class p1(Scene):
    def construct(self):
        # self.add(NumberPlane())
        frame = self.camera.frame
        self.play(frame.animate.set_height(4))
        li=['','Y','','','Y','Z','+','','Z','Z','1','4','1','6']
        location=[[0,2,0],[1,2,0],[2,2,0],[0,1,0],[1,1,0],[2,1,0],[-1,0,0],[0,0,0],[1,0,0],[2,0,0],[-1,-1,0],[0,-1,0],[1,-1,0],[2,-1,0]]
        for i in range(len(li)):
            self.add(Tex(li[i]).move_to(location[i]).shift(DL*0.5).scale(2))
        self.add(Line([-2.2,-1,0],[1.2,-1,0]).shift(RIGHT*0.5))
        self.wait()
class p2(Scene):
    def construct(self):
        # self.add(NumberPlane())
        frame = self.camera.frame
        self.play(frame.animate.set_height(4))
        li=['4','0','4','4','0','0','+','4','0','0','1','2','0','4']
        location=[[0,2,0],[1,2,0],[2,2,0],[0,1,0],[1,1,0],[2,1,0],[-1,0,0],[0,0,0],[1,0,0],[2,0,0],[-1,-1,0],[0,-1,0],[1,-1,0],[2,-1,0]]
        for i in range(len(li)):
            self.add(Tex(li[i]).move_to(location[i]).shift(DL*0.5).scale(2))
        self.add(Line([-2.2,-1,0],[1.2,-1,0]).shift(RIGHT*0.5))
        self.wait()
class p3(Scene):
    def construct(self):
        # self.add(NumberPlane())
        frame = self.camera.frame
        self.play(frame.animate.set_height(4))
        li=['','Y','','','Y','Z','+','','Z','Z','','2','1','2']
        location=[[0,2,0],[1,2,0],[2,2,0],[0,1,0],[1,1,0],[2,1,0],[-1,0,0],[0,0,0],[1,0,0],[2,0,0],[-1,-1,0],[0,-1,0],[1,-1,0],[2,-1,0]]
        for i in range(len(li)):
            self.add(Tex(li[i]).move_to(location[i]).shift(DL*0.5).scale(2))
        self.add(Tex('0').move_to(location[2]).shift(DL*0.5).scale(2))
        self.add(Line([-2.2,-1,0],[1.2,-1,0]).shift(RIGHT*0.5))
        self.wait()